<!DOCTYPE html>
<!--当前页面是thymeleaf整合数据的页面，需要导入thymeleaf的命名空间-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户数据</title>
</head>
<body>
<center>
    <h1>用户列表</h1>

    <table border="1">
        <tr >
            <td>用户名</td>
            <td>密码</td>
            <td>昵称</td>
            <td>年龄</td>
            <td>操作</td>
        </tr>
        <!--th:each 等价于 for(User user : users)-->
        <tr th:each="user:${users}">
            <!--最终当thymeleaf解析到该标签时，将text中取到的值替换该标签中的文本-->
            <td th:text="${user.getUsername()}">张三</td>
            <td th:text="${user.getPassword()}">123456</td>
            <td th:text="${user.getNikename()}">三三</td>
            <td th:text="${user.getAge()}">18</td>
            <td><a href="#" th:href="@{'toUpdate.do?username='+${user.getUsername()}
                                        +'&password='+${user.getPassword()}
                                        +'&nikename='+${user.getNikename()}
                                        +'&age='+${user.getAge()}
            }">修改用户信息</a></td>
        </tr>
        <!--th:remove 表示thymeleaf解析到该标签时，会将该标签和子标签全部隐藏-->
        <tr th:remove="all">
            <td>李四</td>
            <td>000456</td>
            <td>思思</td>
            <td>19</td>
        </tr>
        <tr th:remove="all">
            <td>王五</td>
            <td>0789456</td>
            <td>五五</td>
            <td>20</td>
        </tr>
    </table>

    <h3><a href="./index.html">放回主页面</a></h3>
</center>
</body>
</html>